import { globalIgnores } from "eslint/config";
import { defineConfigWithVueTs, vueTsConfigs } from "@vue/eslint-config-typescript";
import pluginVue from "eslint-plugin-vue";
import skipFormatting from "@vue/eslint-config-prettier/skip-formatting";

export default defineConfigWithVueTs(
  {
    name: "app/files-to-lint",
    files: ["**/*.{ts,mts,tsx,vue}"],
  },

  globalIgnores(["**/dist/**", "**/dist-ssr/**", "**/coverage/**"]),

  pluginVue.configs["flat/essential"],
  vueTsConfigs.recommended,
  skipFormatting, // 禁用代码格式（格式化）

  // 添加自定义规则配置
  {
    rules: {
      "vue/multi-word-component-names": "off", // 多单词组件命名规则
      "@typescript-eslint/no-explicit-any": ["off"], // 允许使用any类型
    },
  },
);
